
#pragma once
//#include "stdafx.h"
#include <map>

const static int MAX_SIZE = 101;
//const static MAX_IMAGE= 1024*1024*1024*4;

void InitDateTime(COleDateTime&	birthday);

struct Tab1VarStruct{
	//int				id_SinglePageData;
	CString			name;
	CString			nickname;
	COleDateTime	birthday;
	int				age;
	int				twelve;
	int				constellation;
	int				sex;
	int				blood;
	int				marriage;
	CString			school;
	int				degree;
	int				metier;
	int				position;
	CString			picturePath;

	Tab1VarStruct();
	Tab1VarStruct(const Tab1VarStruct& var);

	void Initialize();
	bool operator!=(const Tab1VarStruct& var);
	bool	operator == (const Tab1VarStruct& par){return !(*this!=par);}
	Tab1VarStruct& operator = (const Tab1VarStruct& par);
};
typedef std::map<int, Tab1VarStruct> Tab1VarMap;

struct Tab2VarStruct{
	//int		id_SinglePageData;
	CString	mobilePhone;
	CString	companyPhone;
	CString	homePhone;
	CString	QQ1;
	CString	QQ2;
	CString	MSN1;
	CString	MSN2;
	CString	Skype1;
	CString	Skype2;
	CString	Email1;
	CString	Email2;
	CString	companyAddress;
	CString	familyAddress;
	CString	post;
	CString	homePage;

	Tab2VarStruct();
	Tab2VarStruct(const Tab2VarStruct& var);

	void Initialize();
	bool operator!=(const Tab2VarStruct& var);
	bool	operator == (const Tab2VarStruct& par){return !(*this!=par);}
	Tab2VarStruct& operator = (const Tab2VarStruct& par);
};
typedef std::map<int, Tab2VarStruct> Tab2VarMap;

struct Tab3ListVarStruct{	//**used to define List of ListControl
	int				id_SinglePageData;
	int				id_Tab3ListVarStruct;
	CString			event;
	COleDateTime	meetdate;
	CString			remark;
	CString			backupnbackup;

	Tab3ListVarStruct();
	Tab3ListVarStruct(const Tab3ListVarStruct& var);

	void Initialize();
	bool operator!=(const Tab3ListVarStruct& var);
	bool	operator == (const Tab3ListVarStruct& par){return !(*this!=par);}
	Tab3ListVarStruct& operator = (const Tab3ListVarStruct& par);
};

struct Tab4ListVarStruct{	//**used to define List of ListControl
	int		id_SinglePageData;
	int		id_Tab4ListVarStruct;
	CString	classify;
	CString	message;

	Tab4ListVarStruct();
	Tab4ListVarStruct(const Tab4ListVarStruct& var);

	void Initialize();
	bool operator!=(const Tab4ListVarStruct& var);
	bool	operator == (const Tab4ListVarStruct& par){return !(*this!=par);}
	Tab4ListVarStruct& operator = (const Tab4ListVarStruct& par);
};

struct SinglePageData{		//one persion's data
	//int							id_SinglePageData;
	Tab1VarStruct				tab1Data;
	Tab2VarStruct				tab2Data;
	CList<Tab3ListVarStruct>	tab3DataList;
	CList<Tab4ListVarStruct>	tab4DataList;
	int							listOrder;

	SinglePageData();
	SinglePageData(const SinglePageData& var);

	void Initialize();
	bool operator!=(const SinglePageData& var);
	bool	operator == (const SinglePageData& par){return !(*this!=par);}
	SinglePageData& operator = (const SinglePageData& par);
};
typedef std::map<int, SinglePageData> SinglePageDataMap;

struct ODBC_BindStruct{
	int		ColumnNumber;
	CString	TargetType;
	CString	TargetValuePtr;
	long	BufferLength;
};

namespace TabKind
{
	enum Type
	{
		Tab1	= 10,
		Tab2	= 20,
		Tab3	= 30,
		Tab4	= 40,
	};
};
